<?php

/*
|--------------------------------------------------------------------------
| Module Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for the module.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::get('/manage/login', 'Auth\AuthController@getLogin')->name('loginCreatePage');
Route::post('/manage/login', 'Auth\AuthController@postLogin')->name('loginCreate');
Route::get('/manage/logout', 'Auth\AuthController@getLogout')->name('logout');
Route::group(['prefix' => 'manage', 'middleware' => 'manageauth'], function() {
//	Route::get('/', function() {
//		dd('This is the Manage module index page.');
//	});
    //产品分类列表
    Route::get('/cateList', 'CateController@cateList')->name('cateList');
    //添加产品分类
    Route::match(['get','post'],'/cateInsert', 'CateController@cateInsert')->name('cateInsert');
    //编辑产品分类
    Route::match(['get','post'],'/cateUpdate/{id}','CateController@cateUpdate')->name('cateUpdate');

    //产品列表
    Route::get('/pigProductList','PigProductController@pigProductList')->name('pigProductList');
    //添加产品
    Route::match(['get','post'],'/pigProductInsert','PigProductController@pigProductInsert')->name('pigProductInsert');
    //编辑产品
    Route::match(['get','post'],'/pigProductUpdate/{id}','PigProductController@pigProductUpdate')->name('pigProductUpdate');
    //上传图片
    Route::match(['get','post'],'/pigFileUpload/{id}','PigProductController@pigFileUpload')->name('pigFileUpload');
    //删除图片
    Route::post('/pigFileDel','PigProductController@pigFileDel')->name('pigFileDel');



    Route::get('/', 'IndexController@getManage')->name('backstagePage');
    Route::get('/clearCache', 'IndexController@clearCache')->name('clearCache');

    Route::get('/addRole', 'IndexController@addRole')->name('roleCreate');
    Route::get('/addPermission', 'IndexController@addPermission')->name('permissionCreate');
    Route::get('/attachRole', 'IndexController@attachRole')->name('attachRoleCreate');
    Route::get('/attachPermission', 'IndexController@attachPermission')->name('attachPermissionCreate');


    Route::get('/config', 'ConfigController@getConfigBasic')->name('configDetail');
    Route::get('/config/basic', 'ConfigController@getConfigBasic')->name('basicConfigDetail');
    Route::post('/config/basic', 'ConfigController@saveConfigBasic')->name('configBasicUpdate');
    Route::get('/config/seo', 'ConfigController@getConfigSEO')->name('seoConfigDetail');
    Route::post('/config/seo', 'ConfigController@saveConfigSEO')->name('configSeoUpdate');
    Route::get('/config/nav', 'ConfigController@getConfigNav')->name('navConfigDetail');
    Route::post('/config/nav', 'ConfigController@postConfigNav')->name('configNavCreate');
    Route::get('/config/nav/{id}/delete', 'ConfigController@deleteConfigNav')->name('configNavDelete');
    Route::get('/config/attachment', 'ConfigController@getAttachmentConfig')->name('attachmentConfigDetail');
    Route::post('/config/attachment', 'ConfigController@postAttachmentConfig')->name('attachmentConfigCreate');


    Route::get('/config/site', 'ConfigController@getConfigSite')->name('siteConfigDetail');
    Route::post('/config/site', 'ConfigController@saveConfigSite')->name('configSiteUpdate');
    Route::get('/config/email', 'ConfigController@getConfigEmail')->name('emailConfigDetail');
    Route::post('/config/email', 'ConfigController@saveConfigEmail')->name('configEmailUpdate');
    Route::post('/config/sendEmail', 'ConfigController@sendEmail')->name('sendEmail');

    Route::get('/config/link', 'ConfigController@configLink')->name('configLink');
    Route::post('/config/link', 'ConfigController@link')->name('postConfigLink');

    Route::get('/config/phone', 'ConfigController@getConfigPhone')->name('phoneConfigDetail');
    Route::post('/config/phone', 'ConfigController@saveConfigPhone')->name('configphoneUpdate');

    Route::get('/config/appalipay', 'ConfigController@getConfigAppAliPay')->name('getConfigAppAliPay');
    Route::post('/config/appalipay', 'ConfigController@saveConfigAppAliPay')->name('configAppAliPayUpdate');

    Route::get('/config/appwechat', 'ConfigController@getConfigAppWeChat')->name('getConfigAppWeChat');
    Route::post('/config/appwechat', 'ConfigController@saveConfigAppWeChat')->name('configAppWeChatUpdate');

    Route::get('/config/wechatpublic', 'ConfigController@getConfigWeChatPublic')->name('getConfigWeChatPublic');
    Route::post('/config/wechatpublic', 'ConfigController@saveConfigWeChatPublic')->name('configWeChatPublicUpdate');

    Route::get('/inviteManage', 'inviteManageController@index')->name('inviteManageList');
    Route::get('/inviteManageAdd', 'inviteManageController@add')->name('inviteManageAdd');
    Route::post('/inviteManageAdd', 'inviteManageController@postAdd')->name('inviteManageAddPost');
    Route::get('/inviteManageDelete/{id}', 'inviteManageController@delete')->name('inviteManageDelete');
    Route::get('/inviteManageEdit/{id}', 'inviteManageController@edit')->name('inviteManageEdit');
    Route::post('/inviteManageEdit/{id}', 'inviteManageController@postEdit')->name('inviteManageEditPost');

    //菜单管理
    Route::get('/menuList/{id}/{level}','MenuController@getMenuList')->name('getMenuList');
    Route::get('/addMenu/{id?}','MenuController@addMenu')->name('addMenu');
    Route::post('/menuCreate','MenuController@menuCreate')->name('menuCreate');
    Route::get('/menuDelete/{id}','MenuController@menuDelete')->name('menuDelete');
    Route::get('/menuUpdate/{id}','MenuController@menuUpdate')->name('menuUpdate');
    Route::post('/updateMenu','MenuController@updateMenu')->name('updateMenu');

    //导航
    Route::get('/navList','NavController@navList')->name('navList');
    Route::get('/addNav','NavController@addNav')->name('navCreatePage');
    Route::post('/addNav','NavController@postAddNav')->name('navCreate');
    Route::get('/editNav/{id}','NavController@editNav')->name('navUpdatePage');
    Route::post('/editNav','NavController@postEditNav')->name('navUpdate');
    Route::get('/deleteNav/{id}','NavController@deleteNav')->name('navDelete');
    Route::get('/isFirst/{id}','NavController@isFirst')->name('isFirst');

//    地区

    Route::get('/area','AreaController@areaList')->name('areaList');
    Route::post('/areaCreate','AreaController@areaCreate')->name('areaCreate');
    Route::get('/areaDelete/{id}','AreaController@areaDelete')->name('areaDelete');
    Route::get('/ajaxcity','AreaController@ajaxCity')->name('ajaxCity');
    Route::get('/ajaxarea','AreaController@ajaxArea')->name('ajaxArea');

    //文章

    Route::get('/article/{upID}','ArticleController@articleList')->name('articleList');
    Route::get('/articleFooter/{upID}','ArticleController@articleList')->name('articleFooterList');
    Route::get('/addArticle/{upID}','ArticleController@addArticle')->name('articleCreatePage');
    Route::get('/addArticleFooter/{upID}','ArticleController@addArticle')->name('articleFooterCreatePage');
    Route::post('/addArticle', 'ArticleController@postArticle')->name('articleCreate');
    Route::get('/articleDelete/{id}/{upID}','ArticleController@articleDelete')->name('articleDelete');
    Route::get('/editArticle/{id}/{upID}','ArticleController@editArticle')->name('articleUpdatePage');
    Route::get('/editArticleFooter/{id}/{upID}','ArticleController@editArticle')->name('articleFooterUpdatePage');
    Route::post('/editArticle', 'ArticleController@postEditArticle')->name('articleUpdate');
    Route::post('/allDelete', 'ArticleController@allDelete')->name('allDelete');

    //文章分类

    Route::get('/categoryList/{upID}','ArticleCategoryController@categoryList')->name('categoryList');
    Route::get('/categoryFooterList/{upID}','ArticleCategoryController@categoryList')->name('categoryFooterList');
    Route::get('/categoryDelete/{id}/{upID}','ArticleCategoryController@categoryDelete')->name('categoryDelete');
    Route::get('/categoryAdd/{upID}','ArticleCategoryController@categoryAdd')->name('categoryCreatePage');
    Route::post('/categoryAdd', 'ArticleCategoryController@postCategory')->name('categoryCreate');
    Route::get('/categoryEdit/{id}/{upID}','ArticleCategoryController@categoryEdit')->name('categoryUpdatePage');
    Route::post('/categoryEdit','ArticleCategoryController@postEditCategory')->name('categoryUpdate');
    Route::post('/categoryAllDelete','ArticleCategoryController@cateAllDelete')->name('categoryAllDelete');
    Route::get('/getChildCateList/{id}','ArticleCategoryController@getChildCateList')->name('getChildCateList');
    Route::get('/categoryFooterAdd/{upID}','ArticleCategoryController@categoryAdd')->name('categoryFooterCreatePage');
    Route::get('/categoryFooterEdit/{id}/{upID}','ArticleCategoryController@categoryEdit')->name('categoryFooterUpdatePage');
    Route::get('/add/{upID}','ArticleCategoryController@add')->name('addCategory');
    Route::get('/edit/{id}/{upID}','ArticleCategoryController@edit')->name('editCategory');


    //权限管理
    Route::get('/permissionsList', 'UserController@getPermissionsList')->name('permissionsList');
    Route::get('/permissionsAdd', 'UserController@getPermissionsAdd')->name('permissionsCreatePage');
    Route::post('/permissionsAdd', 'UserController@postPermissionsAdd')->name('permissionsCreate');
    Route::get('/permissionsDel/{id}', 'UserController@getPermissionsDel')->name('permissionsDelete');
    Route::get('/permissionsDetail/{id}', 'UserController@getPermissionsDetail')->name('permissionsDetail');
    Route::post('/permissionsDetail', 'UserController@postPermissionsDetail')->name('postPermissionsDetailUpdate');

    //用户管理
    Route::get('/userList', 'UserController@getUserList')->name('userList');
    Route::get('/handleUser/{uid}/{action}', 'UserController@handleUser')->name('userStatusUpdate');
    Route::get('/userAdd', 'UserController@getUserAdd')->name('userCreatePage');
    Route::post('/userAdd', 'UserController@postUserAdd')->name('userCreate');
    Route::post('checkUserName', 'UserController@checkUserName')->name('checkUserName');
    Route::post('checkEmail', 'UserController@checkEmail')->name('checkEmail');
    Route::get('/userEdit/{uid}', 'UserController@getUserEdit')->name('userUpdatePage');
    Route::post('/userEdit', 'UserController@postUserEdit')->name('userUpdate');
    Route::get('/managerList', 'UserController@getManagerList')->name('managerList');
    Route::get('/handleManage/{uid}/{action}', 'UserController@handleManage')->name('userStatusUpdate');
    Route::get('/managerAdd', 'UserController@managerAdd')->name('managerCreatePage');
    Route::post('/managerAdd', 'UserController@postManagerAdd')->name('managerCreate');
    Route::post('checkManageName', 'UserController@checkManageName')->name('checkManageName');
    Route::post('checkManageEmail', 'UserController@checkManageEmail')->name('checkManageEmail');
    Route::get('/managerDetail/{id}', 'UserController@managerDetail')->name('managerDetail');
    Route::post('/managerDetail', 'UserController@postManagerDetail')->name('managerDetailUpdate');
    Route::get('/managerDel/{id}', 'UserController@managerDel')->name('managerDelete');
    Route::post('/managerDeleteAll', 'UserController@postManagerDeleteAll')->name('managerAllDelete');

    Route::get('/rolesList', 'UserController@getRolesList')->name('rolesList');
    Route::get('/rolesAdd', 'UserController@getRolesAdd')->name('rolesCreatePage');
    Route::post('/rolesAdd', 'UserController@postRolesAdd')->name('rolesCreate');
    Route::get('/rolesDel/{id}', 'UserController@getRolesDel')->name('rolesDelete');
    Route::get('/rolesDetail/{id}', 'UserController@getRolesDetail')->name('rolesDetail');
    Route::post('/rolesDetail', 'UserController@postRolesDetail')->name('rolesDetailUpdate');

    //留言管理
    Route::get('/message','MessageController@messageList')->name('message');
    Route::post('/messageDel/{id}','MessageController@messageDelete')->name('messageDelete');

    Route::get('/bannerManage/{target_id}', 'BannerController@getList')->name('bannerManage');
    Route::get('/bannerInsert', 'BannerController@getInsertAd')->name('bannerInsert');
    Route::post('/bannerInsert', 'BannerController@postInsertAd');
    Route::get('/bannerUpdate/{id}', 'BannerController@getUpdate')->name('bannerUpdate');
    Route::post('/bannerUpdate/{id}', 'BannerController@postUpdate');
    Route::get('/bannerdelete/{id}', 'BannerController@getDelete')->name('bannerDelete');

    Route::get('/link', 'LinkController@linkList')->name('linkList');
    Route::post('/addlink', 'LinkController@postAdd')->name('linkCreate');
    Route::get('/editlink/{id}', 'LinkController@getEdit')->name('linkUpdatePage');
    Route::get('/deletelink/{id}', 'LinkController@getDeleteLink')->name('linkDelete');
    Route::post('/allDeleteLink', 'LinkController@allDeleteLink')->name('allLinkDelete');
    Route::get('/handleLink/{id}/{action}', 'LinkController@handleLink')->name('linkStatusUpdate');
    Route::post('/updatelink/{id}', 'LinkController@postUpdateLink')->name('linkUpdate');

    //新闻

    Route::get('/news/{upID}','NewsController@newsList')->name('news');
    Route::get('/newsFooter/{upID}','NewsController@newsList')->name('newsFooterList');
    Route::get('/addNews/{upID}','NewsController@addNews')->name('newsCreatePage');
    Route::get('/addNewsFooter/{upID}','NewsController@addNews')->name('newsFooterCreatePage');
    Route::post('/addNews', 'NewsController@postNews')->name('newsCreate');
    Route::get('/newsDelete/{id}/{upID}','NewsController@newsDelete')->name('newsDelete');
    Route::get('/editnews/{id}/{upID}','NewsController@editNews')->name('newsUpdatePage');
    Route::get('/editNewsFooter/{id}/{upID}','NewsController@editNews')->name('newsFooterUpdatePage');
    Route::post('/editnews', 'NewsController@postEditNews')->name('newsUpdate');
    Route::post('/newsallDelete', 'NewsController@allDelete')->name('newsallDelete');

    //新闻分类

    Route::get('/newscategoryList/{upID}','NewsCategoryController@categoryList')->name('newscategoryList');
    Route::get('/newscategoryFooterList/{upID}','NewsCategoryController@categoryList')->name('newscategoryFooterList');
    Route::get('/newscategoryDelete/{id}/{upID}','NewsCategoryController@categoryDelete')->name('newscategoryDelete');
    Route::get('/newscategoryAdd/{upID}','NewsCategoryController@categoryAdd')->name('newscategoryCreatePage');
    Route::post('/newscategoryAdd', 'NewsCategoryController@postCategory')->name('newscategoryCreate');
    Route::get('/newscategoryEdit/{id}/{upID}','NewsCategoryController@categoryEdit')->name('newscategoryUpdatePage');
    Route::post('/newscategoryEdit','NewsCategoryController@postEditCategory')->name('newscategoryUpdate');
    Route::post('/newscategoryAllDelete','NewsCategoryController@cateAllDelete')->name('newscategoryAllDelete');
    Route::get('/newsgetChildCateList/{id}','NewsCategoryController@getChildCateList')->name('newsgetChildCateList');
    Route::get('/newscategoryFooterAdd/{upID}','NewsCategoryController@categoryAdd')->name('newscategoryFooterCreatePage');
    Route::get('/newscategoryFooterEdit/{id}/{upID}','NewsCategoryController@categoryEdit')->name('newscategoryFooterUpdatePage');
    Route::get('/newsadd/{upID}','NewsCategoryController@add')->name('newsaddCategory');
    Route::get('/newsedit/{id}/{upID}','NewsCategoryController@edit')->name('newseditCategory');

    //产品

    Route::get('/product/{upID}','ProductController@productList')->name('product');
    Route::get('/productFooter/{upID}','ProductController@productList')->name('productFooterList');
    Route::get('/addProduct/{upID}','ProductController@addProduct')->name('productCreatePage');
    Route::get('/addProductFooter/{upID}','ProductController@addProduct')->name('productFooterCreatePage');
    Route::post('/addProduct', 'ProductController@postProduct')->name('productCreate');
    Route::get('/productDelete/{id}/{upID}','ProductController@productDelete')->name('productDelete');
    Route::get('/editproduct/{id}/{upID}','ProductController@editProduct')->name('productUpdatePage');
    Route::get('/editProductFooter/{id}/{upID}','ProductController@editProduct')->name('productFooterUpdatePage');
    Route::post('/editproduct', 'ProductController@postEditProduct')->name('productUpdate');
    Route::post('/productallDelete', 'ProductController@allDelete')->name('productallDelete');

    //产品分类

    Route::get('/productcategoryList/{upID}','ProductCategoryController@categoryList')->name('productcategoryList');
    Route::get('/productcategoryFooterList/{upID}','ProductCategoryController@categoryList')->name('productcategoryFooterList');
    Route::get('/productcategoryDelete/{id}/{upID}','ProductCategoryController@categoryDelete')->name('productcategoryDelete');
    Route::get('/productcategoryAdd/{upID}','ProductCategoryController@categoryAdd')->name('productcategoryCreatePage');
    Route::post('/productcategoryAdd', 'ProductCategoryController@postCategory')->name('productcategoryCreate');
    Route::get('/productcategoryEdit/{id}/{upID}','ProductCategoryController@categoryEdit')->name('productcategoryUpdatePage');
    Route::post('/productcategoryEdit','ProductCategoryController@postEditCategory')->name('productcategoryUpdate');
    Route::post('/productcategoryAllDelete','ProductCategoryController@cateAllDelete')->name('productcategoryAllDelete');
    Route::get('/productgetChildCateList/{id}','ProductCategoryController@getChildCateList')->name('productgetChildCateList');
    Route::get('/productcategoryFooterAdd/{upID}','ProductCategoryController@categoryAdd')->name('productcategoryFooterCreatePage');
    Route::get('/productcategoryFooterEdit/{id}/{upID}','ProductCategoryController@categoryEdit')->name('productcategoryFooterUpdatePage');
    Route::get('/productadd/{upID}','ProductCategoryController@add')->name('productaddCategory');
    Route::get('/productedit/{id}/{upID}','ProductCategoryController@edit')->name('producteditCategory');

    Route::get('/information', 'InformationController@getList')->name('informationList');
    Route::post('/addInformation', 'InformationController@postAdd')->name('informationCreate');
    Route::get('/editInformation/{id}', 'InformationController@getEdit')->name('informationUpdatePage');
    Route::get('/deleteInformation/{id}', 'InformationController@getDeleteInformation')->name('informationDelete');
    Route::post('/allDeleteInformation', 'InformationController@allDeleteInformation')->name('allInformationDelete');
    Route::get('/handleInformation/{id}/{action}', 'InformationController@handleInformation')->name('informationStatusUpdate');
    Route::post('/updateInformation/{id}', 'InformationController@postUpdateInformation')->name('informationUpdate');

    //案例管理
    Route::get('/successCaseList','SuccessCaseController@successCaseList')->name('successCaseList');
    Route::get('/successCaseAdd','SuccessCaseController@create')->name('successCaseCreatePage');
    Route::post('/successCaseUpdate','SuccessCaseController@update')->name('successCaseCreate');
    Route::get('/successCaseDel/{id}','SuccessCaseController@successCaseDel')->name('successCaseDel');
    Route::post('/ajaxGetSecondCate','SuccessCaseController@ajaxGetSecondCate')->name('ajaxGetSecondCate');


});
